Title: SQL W3S (By-BKK) / 007 AND
Tags: Obsidian_to_Anki

Q: What does the AND operator do in SQL?
A: Filters records based on more than one condition

Q: True/False: All conditions must be true for AND to return a record
A: True

Q: How do you select Spanish customers whose names start with 'G'?
A: SELECT * FROM Customers WHERE Country='Spain' AND CustomerName LIKE 'G%'

Q: What is the syntax for multiple AND conditions in WHERE?
A: SELECT column1 FROM table_name WHERE condition1 AND condition2 AND condition3

Q: What is the difference between AND and OR in SQL?
A: AND requires all conditions to be true, OR requires at least one

Q: How do you combine AND and OR for complex filters?
A: Use parenthesis to group OR conditions with AND

Q: Write a SQL query to select Spanish customers whose name starts with 'G' or 'R'
A: SELECT * FROM Customers WHERE Country='Spain' AND (CustomerName LIKE 'G%' OR CustomerName LIKE 'R%')

Q: What happens if you omit parenthesis when combining AND and OR?
A: SQL may not filter results as expected

Q: Filters records based on more than one condition
A: What does the AND operator do in SQL?

Q: True
A: Must all conditions be true for SQL AND to return a record?

Q: SELECT * FROM Customers WHERE Country='Spain' AND CustomerName LIKE 'G%'
A: How do you select all Spanish customers whose names start with 'G'?